package com.lp.biz.order.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import static com.lp.common.constant.CommonConstant.DATE_TIME;
import static com.lp.common.constant.CommonConstant.TIMEZONE;
import static com.lp.common.utils.Tools.stripTrailingZeros;

/**
 * @program: backend
 * @description:
 * @author: Ke.Song
 * @since: 2024-06-25 22:00:19
 */
@Data
public class OrderDetail {

    private String orderNum;

    private Integer payMethod;

    @JsonFormat(timezone = TIMEZONE, pattern = DATE_TIME)
    private LocalDateTime createAt;

    @JsonFormat(timezone = TIMEZONE, pattern = DATE_TIME)
    private LocalDateTime payAt;

    private Integer orderType;

    private Integer membersType;

    private String title;

    private String realName;

    private String phone;

    private BigDecimal actualPrice;

    private BigDecimal payPrice;

    private Integer memberId;

    private Integer status;

    private String reason;

    @JsonFormat(timezone = TIMEZONE, pattern = DATE_TIME)
    private LocalDateTime refundAt;

    private BigDecimal commissionCharge;

    private BigDecimal refundPrice;

    /**
     * 佣金
     */
    private BigDecimal kickbackCharge;

    /**
     * 优惠券金额
     */
    private BigDecimal couponCharge;

    public void setKickbackCharge(BigDecimal kickbackCharge) {
        this.kickbackCharge = stripTrailingZeros(kickbackCharge);
    }

    public void setCouponCharge(BigDecimal couponCharge) {
        this.couponCharge = stripTrailingZeros(couponCharge);
    }

    public void setActualPrice(BigDecimal actualPrice) {
        this.actualPrice = stripTrailingZeros(actualPrice);
    }

    public void setCommissionCharge(BigDecimal commissionCharge) {
        this.commissionCharge = stripTrailingZeros(commissionCharge);
    }

    public void setRefundPrice(BigDecimal refundPrice) {
        this.refundPrice = stripTrailingZeros(refundPrice);
    }

    public void setPayPrice(BigDecimal payPrice) {
        this.payPrice = stripTrailingZeros(payPrice);
    }
}
